using Bean.Entity.Model;
using Bean.Infrastructure;
using Bean.Repository;
using Bean.Service.IService;
using Microsoft.Extensions.Logging;

namespace Bean.Service.Service;

/// <summary>
/// 展位服务
/// </summary>
public class ExhibitService : IExhibitService, ITransientService
{
    public readonly ILogger<ExhibitService> _logger;

    private readonly IRepository<Exhibit> _repository;

    public ExhibitService(ILogger<ExhibitService> logger, IRepository<Exhibit> repository)
    {
        _logger = logger;
        _repository = repository;
    }

    /// <summary>
    /// 通过展位Id 获取展位信息
    /// </summary>
    /// <param name="exhibitIds"></param>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    public async Task<List<Exhibit>> GetExhibit(List<long> exhibitIds)
    {
        var exhibitList = await _repository.AsQueryable().Where(w => exhibitIds.Contains(w.exhibitid)).ToListAsync();
        
        return exhibitList;
    }
}